Errbox("Message from DeskMen","Your menu file has been created. If you need to change it back to text use the convert utility supplied with the program. To see your menu click OK, otherwise click CANCEL",2)=1
"WimpExt_CloseDown",id%
"Wimp_CloseDown"
Getandstoretitle
line$>39
er%=
Imm("The title '"+
line$,2)+"' is too long."):
$((!menblk%)+mem%)=line$+
mem%+=
line$+1
men%+=1
Process
men%<=0
Imm("Error when creating menu: Syntax error in definition file."):er%=
line$>27
er%=
Imm("The item '"+line$+"' is too long."):
$((!menblk%)+mem%)=line$+
mem%+=
line$+1
line$=
#handle%
line$="}"
$((!menblk%)+mem%)=line$+
0:mem%+=
line$+1:men%=men%-1:
line$,1)
"|" :
"{" :
Getandstoretitle:
"}" : $((!menblk%)+mem%)=line$+
0:mem%+=
line$+1:men%=men%-1:
"XOS_File",17,line$
found%
found%=0
Imm("Error when creating menu: Item '"+line$+"' dosen't exist."):er%=
$((!menblk%)+mem%)=line$+
mem%+=
line$+1
Loadmenu
"XOS_File",17,"<DMen$Dir>.MenuDef"
,,,,len%;error%
error%
Imm("Fatal error: Error when reading menu definiton file, suggest delete file and re-create. Must exit and die."):quit%=
"WimpExt_Heap",2,,len%
,menhand%
menhand%=0
Imm("Fatal error: Memory allocation failed, try freeing some memory, then re-load"):quit%=
menblk%=!menhand%
"OS_File",16,"<DMen$Dir>.MenuDef",menblk%,0
x%=0
id$+=
(menblk%?x%)
id$<>"MENU" quit%=2:
Imm("This is an old style menu file, or file is corrupt."):
x%=menblk%+4
menblk%+len%
?x%=?x%
!menblk%=!(menblk%-4)-4
menblk%+=4
"Hourglass_Smash"
"WimpExt_ShadeEntry",,barmenu%,2,0
Openmain
Wipemenu
len%=!(menblk%-4)
curmenu%=1
curritem%=1
ptr%=menblk%
title$=
String(ptr%)
ptr%+=
title$+1
title$=
title$,2)
"WimpExt_SetWindowTitle",,,menuw%,title$
ptr%>menblk%+len%
Imm("Swirly thing alert - Many overflow my memory has? I'm feeling rather depressed! Shall exit and die."):quit%=
Imm("Swirly thing alert - Many overflow my memory has? I'm feeling rather depressed! Shall exit and die."):quit%=
ptr%+=1
path$=
String(ptr%)
path$,1)
"{" :
Gomenu
"*" :
"XOS_CLI",path$
Load(path$)
Sendhelp(help$)
"WimpExt_SendHelp",help$,block%
Menuhelp
"Wimp_GetMenuState",1,buffer%,block%!32,block%!36
!buffer%
3 :
Sendhelp("Click here to quit DeskMen, though why you'd want to is beyond me!")
2 :
Sendhelp("Slide right to reveal a save box, this allows you to save the menu in plain text, ready for editing.")
1 :
Sendhelp("Click here to open the options window, this allows you to customise various aspects of DeskMen. The options window can also be opened by clicking ajust on the iconbar icon.")
0 :
Sendhelp("This option leads to a standard info box.")
-1 :
Sendhelp("Ohh! Your sooooooo good with that mouse!!")
Gomenu
len%=!(menblk%-4)
ptr%=menblk%
ptr%=ptr%-1
curmenu%=0
ptr%+=1
text$=
String(ptr%)
text$,1)="{"
curmenu%+=1
ptr%+=
text$
text$=path$
ptr%>menblk%+len%
ptr%>menblk%+len%
Imm("Swirly thing alert - Many overflow my memory has? I'm feeling rather depressed! Shall exit and die."):quit%=
ptr%=ptr%-
text$
!block%=menuw%
"Wimp_CloseWindow",,block%
curritem%=1
Wipemenu
title$=
String(ptr%)
ptr%+=
title$+1
title$=
title$,2)
"WimpExt_SetWindowTitle",,,menuw%,title$
ptr%>menblk%+len%
Imm("Swirly thing alert - Many overflow my memory has? I'm feeling rather depressed! Shall exit and die."):quit%=